package po;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import play.Logger;

public class InformationPo {

	private static DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	private int id;
	
	private String hostIP;
	
	private String hostName;
	
	private String info;
	
	private String type;
	
	private Date collectDate;
	
	public InformationPo(){}
	
	public InformationPo(String host_ip, String host_name, String info, String type, Date collect_date){
		this.hostIP = host_ip;
		this.hostName = host_name;
		this.info = info;
		this.type = type;
		this.collectDate = collect_date;
	}
	
	public void setId(int id){
		this.id = id;
	}
	
	public void setHostIP(String host_ip){
		this.hostIP = host_ip;
	}
	
	public void setHostName(String host_name){
		this.hostName = host_name;
	}
	
	public void setInfo(String info){
		this.info = info;
	}
	
	public void setType(String type){
		this.type = type;
	}
	
	public void setCollectDate(Date collect_date){
		this.collectDate = collect_date;
	}
	
	public int getId(){
		return id;
	}
	
	public String getHostIP(){
		return hostIP;
	}
	
	public String getHostName(){
		return hostName;
	}
	
	public String getInfo(){
		return info;
	}
	
	public String getType(){
		return type;
	}
	
	public String getCollectDate(){
		try{
			return format.format(collectDate);
		}catch(Exception e){
			Logger.error(e.getMessage());
			return null;
		}
	}
}
